<%@ page language="java" import="java.util.*,cn.biwysh.exam.entity.User" pageEncoding="utf-8"%>
<%@page import="cn.biwysh.exam.entity.Exam,cn.biwysh.exam.entity.Score"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
User user = null;
if (session.getAttribute("userqt") != null) {
	user = (User) session.getAttribute("userqt");
}else{
	response.sendRedirect("index.do");
}
Exam exam=new Exam(0,"该考核已被删除",new Date(),new Date(),0,0,0,0,0,0,0);
if(request.getAttribute("exam")!=null){
	exam=(Exam)request.getAttribute("exam");
}
Score score=new Score();
score.setAddtime(new Date());
score.setTotal(0.0);
score.setKgscore(0.0);
if(request.getAttribute("score")!=null){
	score=(Score)request.getAttribute("score");
}
boolean isOver=false;
if(request.getAttribute("isover")!=null){
	isOver=(Boolean)request.getAttribute("isover");
}
Double maxscore=0.0;
if(request.getAttribute("maxscore")!=null){
	maxscore=(Double)request.getAttribute("maxscore");
}
Integer totalpeople=0;
if(request.getAttribute("totalpeople")!=null){
	totalpeople=(Integer)request.getAttribute("totalpeople");
}
int mymc=0;
if(request.getAttribute("mymc")!=null){
	mymc=(Integer)request.getAttribute("mymc");
}
String jiangxiang="";
if(request.getAttribute("jiangxiang")!=null){
	jiangxiang=(String)request.getAttribute("jiangxiang");
}
Date now=new Date();
String backurl="mykh.do";
if(request.getParameter("back")!=null){
	backurl="self.do";
}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>历史考核</title>
    <link href="css/qt/lskh.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="script/jquery/jquery-1.5.1.min.js">
        </script>
    <script type="text/javascript">
	    $(function() {
	        if(!window.ActiveXObject){
	            $("#footht").css("height","20px");
	        }
	        initZYbg();
	   	    $(window).resize(function() {
			    initZYbg();
			   });
	    });
function initZYbg(){ 
	//alert($(document).width());
       if(document.body.clientWidth<957){
	        $("#mainleft").width(0);
	        $("#mainright").width(0);
	        $("#mainleft").css("display","none");
		    $("#mainright").css("display","none");
        }else{
	       if(!window.ActiveXObject){
		        var wid=($(document).width()-953)/2;
		        $("#mainleft").width(wid);
		        $("#mainright").width(wid);
		        $("#mainleft").css("display","block");
		        $("#mainright").css("display","block");
		    }else{
		        var wid=($(document).width()-974)/2;
		        if(wid>0){
		        	$("#mainleft").width(wid);
			        $("#mainright").width(wid);
			        $("#mainleft").css("display","block");
			        $("#mainright").css("display","block");
		        }
		    }
        }
}
    </script>
  </head>
  
  <body>
    <div id="mainleft"><img src="img/qt/mainleft.jpg" style="width:100%;height:100%;"/></div>
     <div id="main">
      <div id="top">
            <jsp:include page="title.jsp" flush="true">
             <jsp:param name="jspName" value="mykh" />
           </jsp:include>
           <div class="clear"></div>
       </div>
       <div id="tgTXT">
           <div id="tiao" style=""></div>
           <div id="mainbg">
	           <div style="height:10px;"> </div>
	           <div id="nowlist">
	             <table id="nlist" cellpadding="0" cellspacing="0">
	           		 <tr>
	           		   <td>
	           		     <span><%=exam.getName() %></span>
	           		   </td>
	           	     </tr>
	             </table>
	           </div>
	           <div style="height:40px;"> </div>
	           <table id="jpshow" cellpadding="0" cellspacing="0">
	           <tr>
	             <td>有效期：<%=exam.getStimestr() %>─<%=exam.getEtimestr() %></td>
	           </tr>
	            <%if(exam.getEndtime().after(now)){//考试还未结束%>
	            	<%if(exam.isIsexamed()){%>
		            <tr>
		             <td>您于<%=score.getAtimestr() %>完成了本测试</td>
		            </tr>
		            <tr>
		             <td>考试还未结束，谢谢您的关注。</td>
		            </tr> 
		           <%}else{ %>
		        	 <tr>
		              <td>您还没有参加本次考试</td>
		             </tr> 
		             <tr>
		              <td>考试正在进行中，欢迎您的参与</td>
		             </tr> 
		             <tr>
		             <td>敬请关注，谢谢参与</td>
		            </tr>
		           <%} %>
	            	
	             <%}else{//考试已结束%>
	            	  <%if(isOver){%>
				            <%if(exam.isIsexamed()){%>
				            <tr>
				             <td>您于<%=score.getAtimestr() %>完成了本测试</td>
				            </tr>
				            <tr>
				             <td>成绩：<%=score.getTotal() %>分&nbsp;&nbsp;&nbsp;&nbsp;名次：<%=mymc %>&nbsp;&nbsp;&nbsp;&nbsp;<%=jiangxiang %></td>
				            </tr> 
				           <%}else{ %>
				        	 <tr>
				              <td>本次测试已过期，请参与其他测试</td>
				             </tr> 
				           <%} %>
				           <tr>
				             <td>共有<%=totalpeople %>人参加此次测试，最高分<%=maxscore %>分</td>
				           </tr> 
			           <%}else{ %>
			        	 <%if(exam.isIsexamed()){%>
				            <tr>
				             <td>您于<%=score.getAtimestr() %>完成了本测试</td>
				            </tr>
				            <tr>
				             <td>正在紧张阅卷中，于测试结束后第三天公布获奖结果</td>
				            </tr> 
				             <tr>
				             <td>敬请关注，谢谢参与</td>
				            </tr> 
				           <%}else{ %>
				        	 <tr>
				              <td>本次测试已过期，请参与其他测试</td>
				             </tr> 
				             <tr>
				              <td>正在紧张阅卷中，于测试结束后第三天公布获奖结果</td>
				             </tr> 
				             <tr>
				             <td>敬请关注，谢谢参与</td>
				            </tr>
				           <%} %>
			              <%} %>
	             	 
	             <%}%>
	           
	           </table>
	           <div id="imgshow">
		         <a href="<%=backurl %>" style="margin-top: 50px; display:block;width:70px;"><img src="img/qt/fanhui1.jpg" style="border:0px;"/></a>
	           </div>
           </div>
           <div id="mainbottom"></div>
       </div>
      <div id="footht" style=""></div>
      <div id="footer">
		  <jsp:include page="footer.jsp" flush="true"></jsp:include>
	   </div>
     </div>
     <div id="mainright"><img src="img/qt/mainright.jpg" style="width:100%;height:100%;"/></div>
  </body>
</html>
